#!/bin/bash

DEBUG_LOG="/tmp/yazi-env-debug.log"

echo "=== Yazi 环境调试 ===" >$DEBUG_LOG
echo "时间: $(date)" >>$DEBUG_LOG
echo "Shell: $SHELL" >>$DEBUG_LOG
echo "当前Shell: $(ps -p $$ -o comm=)" >>$DEBUG_LOG
echo "用户: $(whoami)" >>$DEBUG_LOG
echo "" >>$DEBUG_LOG

echo "=== PATH 环境变量 ===" >>$DEBUG_LOG
echo $PATH | tr ':' '\n' >>$DEBUG_LOG
echo "" >>$DEBUG_LOG

echo "=== 关键命令位置 ===" >>$DEBUG_LOG
which bash >>$DEBUG_LOG
which sh >>$DEBUG_LOG
which python3 >>$DEBUG_LOG
which python >>$DEBUG_LOG
which sed >>$DEBUG_LOG
which awk >>$DEBUG_LOG
echo "" >>$DEBUG_LOG

echo "=== 文件权限 ===" >>$DEBUG_LOG
ls -la ~/.config/yazi/plugins/yazi-mark.sh >>$DEBUG_LOG
echo "" >>$DEBUG_LOG

echo "调试完成，查看: $DEBUG_LOG"
